'''
Created on 2010-11-4

@author: yun_hua
'''

import unittest
import numpy as N
from numheat.geo import Grid

class GridTest(unittest.TestCase):
    def testrectange(self):
        rect = Grid.rectangle(10., 5., 10, 5)
        self.assertEqual(rect.shape, (7, 12, 2))
        self.assertEqual(rect[1, 1, 0], 0.5)
        self.assertEqual(rect[1, 1, 1], 0.5)
        self.assertEqual(rect[5, 10, 0], 9.5)
        self.assertEqual(rect[5, 10, 1], 4.5)